<html>
<head><meta charset="utf-8"><title>Making fmt and clippy work for rustup  linked toolchains. · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html">Making fmt and clippy work for rustup  linked toolchains.</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="233490293"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233490293" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edd Barrett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233490293">(Apr 07 2021 at 13:48)</a>:</h4>
<p>Hi,</p>
<p>I'd like to try to fix <code>cargo fmt</code> and <code>cargo clippy</code> for rustup linked toolchains. Currently these targets do not work as the required binaries are in (e.g.) <code>stage1-tools-bin</code> instead of <code>stage1/bin</code> (I raised <a href="https://github.com/rust-lang/rust/issues/81431">a bug for this here</a>).</p>
<p>Fixing this would make my life easier in a project I'm working on where I currently have to use xtask-based hacks to get the targets running properly.</p>
<p>Can anyone suggest the least offensive way I could fix this? Copying or linking the binaries into the correct bin directory perhaps?</p>
<p>Thanks</p>



<a name="233490339"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233490339" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233490339">(Apr 07 2021 at 13:49)</a>:</h4>
<p><code>extended = true</code> ;)</p>



<a name="233654315"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233654315" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edd Barrett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233654315">(Apr 08 2021 at 13:45)</a>:</h4>
<p>I don't think that helps. We've always had <code>extended=true</code>.</p>
<p>I would verify against the latest rust, but seems the build is broken.</p>



<a name="233654525"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233654525" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233654525">(Apr 08 2021 at 13:46)</a>:</h4>
<p>ah ok I see, the issue is the binaries aren't copied</p>



<a name="233654538"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233654538" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233654538">(Apr 08 2021 at 13:47)</a>:</h4>
<p>I think you could make a PR adding that</p>



<a name="233654581"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233654581" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233654581">(Apr 08 2021 at 13:47)</a>:</h4>
<blockquote>
<p>I would verify against the latest rust, but seems the build is broken.</p>
</blockquote>
<p>how do you mean?</p>



<a name="233655615"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233655615" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edd Barrett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233655615">(Apr 08 2021 at 13:53)</a>:</h4>
<p>I just pulled on the master branch (commit <code>69e1d22</code>) and got:</p>
<div class="codehilite"><pre><span></span><code>   Compiling rustc-ap-rustc_span v705.0.0
error[E0599]: no method named `expect_none` found for enum `Option&lt;Fingerprint&gt;` in the current scope
    --&gt; /home/vext01/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-ap-rustc_span-705.0.0/src/lib.rs:2003:48
     |
2003 |                 cache[index].replace(sub_hash).expect_none(&quot;Cache slot was filled&quot;);
     |                                                ^^^^^^^^^^^ method not found in `Option&lt;Fingerprint&gt;`

error[E0599]: no method named `expect_none` found for enum `Option&lt;u32&gt;` in the current scope
   --&gt; /home/vext01/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-ap-rustc_span-705.0.0/src/hygiene.rs:121:54
    |
121 |             expn_data.orig_id.replace(self.as_u32()).expect_none(&quot;orig_id should be None&quot;);
    |                                                      ^^^^^^^^^^^ method not found in `Option&lt;u32&gt;`

error[E0599]: no method named `expect_none` found for enum `Option&lt;u32&gt;` in the current scope
   --&gt; /home/vext01/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-ap-rustc_span-705.0.0/src/hygiene.rs:205:42
    |
205 |             data.orig_id.replace(raw_id).expect_none(&quot;orig_id should be None&quot;);
    |                                          ^^^^^^^^^^^ method not found in `Option&lt;u32&gt;`

error: aborting due to 3 previous errors
</code></pre></div>



<a name="233655810"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233655810" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edd Barrett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233655810">(Apr 08 2021 at 13:54)</a>:</h4>
<blockquote>
<p>ah ok I see, the issue is the binaries aren't copied</p>
</blockquote>
<p>Right.  I'll just try copying them then... perhaps a bit wasteful, but it will fix the problem.</p>



<a name="233656353"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233656353" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> hyd-dev <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233656353">(Apr 08 2021 at 13:58)</a>:</h4>
<p>I think the errors are because rustfmt and rls are still "build fail" <span aria-label="upside down" class="emoji emoji-1f643" role="img" title="upside down">:upside_down:</span><br>
<a href="/user_uploads/4715/8Vc64Nzfz5yse3ANcGGtYn6x/image.png">image.png</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/8Vc64Nzfz5yse3ANcGGtYn6x/image.png" title="image.png"><img src="/user_uploads/4715/8Vc64Nzfz5yse3ANcGGtYn6x/image.png"></a></div>



<a name="233656576"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233656576" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233656576">(Apr 08 2021 at 13:59)</a>:</h4>
<p><span class="user-mention silent" data-user-id="223288">Edd Barrett</span> <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E/near/233655810">said</a>:</p>
<blockquote>
<blockquote>
<p>ah ok I see, the issue is the binaries aren't copied</p>
</blockquote>
<p>Right.  I'll just try copying them then... perhaps a bit wasteful, but it will fix the problem.</p>
</blockquote>
<p>fwiw this is exactly how the rest of the toolchain works, rustdoc and rustc are also copied</p>



<a name="233656595"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233656595" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233656595">(Apr 08 2021 at 13:59)</a>:</h4>
<p>I would see where that's done and copy the tools at the same time</p>



<a name="233656952"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233656952" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> hyd-dev <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233656952">(Apr 08 2021 at 14:01)</a>:</h4>
<p>Why aren't they hard linked instead?</p>



<a name="233657016"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233657016" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233657016">(Apr 08 2021 at 14:01)</a>:</h4>
<p>oh, they might be</p>



<a name="233657026"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233657026" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233657026">(Apr 08 2021 at 14:01)</a>:</h4>
<p>not sure off the top of my head</p>



<a name="233657280"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233657280" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edd Barrett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233657280">(Apr 08 2021 at 14:02)</a>:</h4>
<p>I considered hard links, but they are less flexible as they can't straddle filesystem boundaries.</p>
<p>I'll just do what is done for other tools...</p>



<a name="233657461"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233657461" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233657461">(Apr 08 2021 at 14:04)</a>:</h4>
<p>putting stage1-tools and stage2 in different filesystems seems like ... a bad idea, since x.py deletes those pretty frequently</p>



<a name="233657868"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233657868" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edd Barrett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233657868">(Apr 08 2021 at 14:06)</a>:</h4>
<p>Agreed :P</p>



<a name="233658638"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233658638" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> hyd-dev <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233658638">(Apr 08 2021 at 14:10)</a>:</h4>
<p>Hard linking may also fail in filesystems that do not support it (such as FAT).<br>
FWIW Cargo has a <code>link_or_copy</code> function: <a href="https://github.com/rust-lang/cargo/blob/58a961314437258065e23cb6316dfc121d96fb71/crates/cargo-util/src/paths.rs#L490-L493">https://github.com/rust-lang/cargo/blob/58a961314437258065e23cb6316dfc121d96fb71/crates/cargo-util/src/paths.rs#L490-L493</a></p>



<a name="233661349"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233661349" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233661349">(Apr 08 2021 at 14:26)</a>:</h4>
<p>I would just set up a directory with symlinks (I use similar setups for a few different cases). Roughly:</p>
<div class="codehilite"><pre><span></span><code>mkdir -p ~/.rustup/toolchains/dev/bin
ln -s `pwd`/build/$HOST/stage1/lib ~/.rustup/toolchains/dev
ln -s `pwd`/build/$HOST/stage1/bin/* ~/.rustup/toolchains/dev/bin
ln -s `pwd`/build/$HOST/stage1-tools-bin/* ~/.rustup/toolchains/dev/bin
</code></pre></div>



<a name="233677623"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233677623" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edd Barrett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233677623">(Apr 08 2021 at 15:46)</a>:</h4>
<p>I'm not sure if I'm going about this right:</p>
<div class="codehilite" data-code-language="Diff"><pre><span></span><code><span class="gh">diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs</span>
<span class="gh">index e85f4628fb0..847b5577035 100644</span>
<span class="gd">--- a/src/bootstrap/tool.rs</span>
<span class="gi">+++ b/src/bootstrap/tool.rs</span>
<span class="gu">@@ -218,6 +218,10 @@ impl Step for ToolBuild {</span>
                 builder.cargo_out(compiler, self.mode, target).join(exe(tool, compiler.host));
             let bin = builder.tools_dir(compiler).join(exe(tool, compiler.host));
             builder.copy(&amp;cargo_out, &amp;bin);
<span class="gi">+            // Also ensure the tool is present in the sysroot so that it can be invoked from rustup</span>
<span class="gi">+            // linked toolchains.</span>
<span class="gi">+            let stage_bin = builder.sysroot(compiler).join("bin").join(exe(tool, compiler.host));</span>
<span class="gi">+            builder.copy(&amp;bin, &amp;stage_bin);</span>
             Some(bin)
         }
     }
<span class="gu">@@ -725,7 +729,13 @@ macro_rules! tool_extended {</span>
 tool_extended!((self, builder),
     Cargofmt, rustfmt, "src/tools/rustfmt", "cargo-fmt", stable=true, {};
     CargoClippy, clippy, "src/tools/clippy", "cargo-clippy", stable=true, in_tree=true, {};
<span class="gd">-    Clippy, clippy, "src/tools/clippy", "clippy-driver", stable=true, in_tree=true, {};</span>
<span class="gi">+    Clippy, clippy, "src/tools/clippy", "clippy-driver", stable=true, in_tree=true, {</span>
<span class="gi">+        builder.ensure(CargoClippy {</span>
<span class="gi">+            compiler: self.compiler,</span>
<span class="gi">+            target: self.target,</span>
<span class="gi">+            extra_features: Vec::new(),</span>
<span class="gi">+        });</span>
<span class="gi">+    };</span>
     Miri, miri, "src/tools/miri", "miri", stable=false, {};
     CargoMiri, miri, "src/tools/miri/cargo-miri", "cargo-miri", stable=false, {};
     Rls, rls, "src/tools/rls", "rls", stable=true, {
</code></pre></div>
<p>The first hunk ensures tools get copied into <code>stageX/bin</code> and the second hunk ensures <code>cargo-clippy</code> is built when <code>clippy-driver</code> is built.</p>
<p>Trying to use <code>cargo clippy</code> via a linked toolchain to the resulting <code>build/x86.../stage1</code> then gives:</p>
<div class="codehilite"><pre><span></span><code>error while loading shared libraries: librustc_driver-d32673f74e22c41d.so: cannot open shared object file: No such file or directory
</code></pre></div>
<p>Am I on the right track?</p>



<a name="233685229"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233685229" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233685229">(Apr 08 2021 at 16:34)</a>:</h4>
<p>does rustdoc work fine from the same directory?</p>



<a name="233685261"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233685261" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233685261">(Apr 08 2021 at 16:35)</a>:</h4>
<p>rustdoc and clippy work essentially the same</p>



<a name="233738360"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233738360" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edd Barrett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233738360">(Apr 08 2021 at 22:07)</a>:</h4>
<p>rustdoc <em>does</em> work, but clippy does not.</p>



<a name="233738595"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233738595" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233738595">(Apr 08 2021 at 22:09)</a>:</h4>
<p>Oh that's extremely strange</p>



<a name="233738608"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233738608" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233738608">(Apr 08 2021 at 22:09)</a>:</h4>
<p>If you run ldd on both is it the same?</p>



<a name="233738638"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233738638" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233738638">(Apr 08 2021 at 22:09)</a>:</h4>
<p>Maybe clippy-driver is overriding the sysroot or something? I wish it didn't do that ...</p>



<a name="233738818"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233738818" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233738818">(Apr 08 2021 at 22:11)</a>:</h4>
<p>Actually you've jogged my memory I think there's an existing issue for this one sec</p>



<a name="233739485"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233739485" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233739485">(Apr 08 2021 at 22:18)</a>:</h4>
<p>I think one of <a href="https://github.com/rust-lang/rust/issues/78778#issuecomment-808729036">https://github.com/rust-lang/rust/issues/78778#issuecomment-808729036</a> or <a href="https://github.com/rust-lang/rust/issues/76666#issuecomment-691670131">https://github.com/rust-lang/rust/issues/76666#issuecomment-691670131</a> may be related</p>



<a name="233739540"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233739540" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233739540">(Apr 08 2021 at 22:18)</a>:</h4>
<p>You could also look how x.py test src/tools/clippy works currently</p>



<a name="233794178"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233794178" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edd Barrett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233794178">(Apr 09 2021 at 09:50)</a>:</h4>
<blockquote>
<p>ldd</p>
</blockquote>
<div class="codehilite" data-code-language="Diff"><pre><span></span><code><span class="gd">--- /tmp/ldd.rustdoc    2021-04-09 10:45:42.583734868 +0100</span>
<span class="gi">+++ /tmp/ldd.clippy-driver      2021-04-09 10:45:53.404102455 +0100</span>
<span class="gu">@@ -1,13 +1,8 @@</span>
<span class="gd">-       linux-vdso.so.1 (0x00007ffeb3fdd000)</span>
<span class="gd">-       libtest-94fa06da86470f19.so =&gt; /home/vext01/source/rust/build/x86_64-unknown-linux-gnu/stage1/bin/../lib/libtest-94fa06da86470f19.so (0x00007f439088e000)</span>
<span class="gd">-       librustc_driver-5c14f2255fac32a9.so =&gt; /home/vext01/source/rust/build/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc_driver-5c14f2255fac32a9.so (0x00007f438848e000)</span>
<span class="gd">-       libstd-86d67478b13a23dc.so =&gt; /home/vext01/source/rust/build/x86_64-unknown-linux-gnu/stage1/bin/../lib/libstd-86d67478b13a23dc.so (0x00007f43882dc000)</span>
<span class="gd">-       libpthread.so.0 =&gt; /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f43882ab000)</span>
<span class="gd">-       libm.so.6 =&gt; /lib/x86_64-linux-gnu/libm.so.6 (0x00007f4388128000)</span>
<span class="gd">-       libgcc_s.so.1 =&gt; /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f438810c000)</span>
<span class="gd">-       libc.so.6 =&gt; /lib/x86_64-linux-gnu/libc.so.6 (0x00007f4387f4b000)</span>
<span class="gd">-       libdl.so.2 =&gt; /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f4387f46000)</span>
<span class="gd">-       libz.so.1 =&gt; /lib/x86_64-linux-gnu/libz.so.1 (0x00007f4387d28000)</span>
<span class="gd">-       libstdc++.so.6 =&gt; /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f4387ba4000)</span>
<span class="gd">-       /lib64/ld-linux-x86-64.so.2 (0x00007f4391022000)</span>
<span class="gd">-       librt.so.1 =&gt; /lib/x86_64-linux-gnu/librt.so.1 (0x00007f4387b98000)</span>
<span class="gi">+       linux-vdso.so.1 (0x00007ffe39171000)</span>
<span class="gi">+       librustc_driver-d32673f74e22c41d.so =&gt; not found</span>
<span class="gi">+       libstd-2c44c75d734c864e.so =&gt; not found</span>
<span class="gi">+       libpthread.so.0 =&gt; /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f0900056000)</span>
<span class="gi">+       libm.so.6 =&gt; /lib/x86_64-linux-gnu/libm.so.6 (0x00007f08ffed3000)</span>
<span class="gi">+       libgcc_s.so.1 =&gt; /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f08ffeb9000)</span>
<span class="gi">+       libc.so.6 =&gt; /lib/x86_64-linux-gnu/libc.so.6 (0x00007f08ffcf6000)</span>
<span class="gi">+       /lib64/ld-linux-x86-64.so.2 (0x00007f090067e000)</span>
</code></pre></div>
<p>Crucially librustc_driver is not found for clippy_driver.</p>



<a name="233794330"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233794330" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edd Barrett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233794330">(Apr 09 2021 at 09:51)</a>:</h4>
<p>The comment in your first link about <code>add_rustc_lib_path()</code> may be something I need to pursue. Investigating...</p>



<a name="233794960"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233794960" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edd Barrett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233794960">(Apr 09 2021 at 09:56)</a>:</h4>
<blockquote>
<p>You could also look how x.py test src/tools/clippy works currently</p>
</blockquote>
<p>It looks like they have to workaround this problem by explicitly setting the sysroot:<br>
<a href="https://github.com/rust-lang/rust/blob/bc66b92f7f1114a78b98504a927ca9c0aa12c71a/src/bootstrap/test.rs#L617-L629">https://github.com/rust-lang/rust/blob/bc66b92f7f1114a78b98504a927ca9c0aa12c71a/src/bootstrap/test.rs#L617-L629</a></p>



<a name="233801302"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233801302" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edd Barrett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233801302">(Apr 09 2021 at 10:53)</a>:</h4>
<p>I'm not having much joy here. If anyone has any ideas, I'm all ears.</p>
<p>I wonder if  <a href="https://github.com/rust-lang/rust/blob/bc66b92f7f1114a78b98504a927ca9c0aa12c71a/src/bootstrap/tool.rs#L492-L497">this</a> has anything to do with it?</p>



<a name="233808794"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233808794" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233808794">(Apr 09 2021 at 12:02)</a>:</h4>
<blockquote>
<ul>
<li><a href="http://librustc_driver-5c14f2255fac32a9.so">librustc_driver-5c14f2255fac32a9.so</a> =&gt; /home/vext01/source/rust/build/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc_driver-5c14f2255fac32a9.so (0x00007f438848e000)</li>
<li><a href="http://librustc_driver-d32673f74e22c41d.so">librustc_driver-d32673f74e22c41d.so</a> =&gt; not found</li>
</ul>
</blockquote>
<p>This looks wrong - the hashes should be the same. Are you sure you copied it into the right stage?</p>



<a name="233808895"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233808895" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233808895">(Apr 09 2021 at 12:02)</a>:</h4>
<blockquote>
<ul>
<li>let stage_bin = builder.sysroot(compiler).join("bin").join(exe(tool, <a href="http://compiler.host">compiler.host</a>));</li>
</ul>
</blockquote>
<p>ok yes this is incorrect - this is the sysroot of the compiler <em>building</em> clippy, not the one it runs with</p>



<a name="233808995"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233808995" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233808995">(Apr 09 2021 at 12:03)</a>:</h4>
<p>forget bootstrap for a second - if you move clippy-driver from stage1/ to stage2/ does it work?</p>



<a name="233812078"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233812078" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edd Barrett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233812078">(Apr 09 2021 at 12:29)</a>:</h4>
<p>So before I didn't have a <code>stage2</code> dir at all, so I did <code>./x.py build --stage 2</code> to get one.</p>
<p>This stage2 included a <code>clippy-driver</code> (presumably due to my changes). When I link stage2 in rustup and use it, it works.</p>
<p>Copying the <code>clippy-driver</code> from <code>stage1/bin</code> to <code>stage2/bin</code> and using the stage2 toolchain also works.</p>



<a name="233812263"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233812263" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233812263">(Apr 09 2021 at 12:30)</a>:</h4>
<p>ok cool, so I think you should be able to fix this by using that sysroot when copying the binary</p>



<a name="233812297"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233812297" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edd Barrett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233812297">(Apr 09 2021 at 12:31)</a>:</h4>
<p>Thanks -- I'll give it a shot!</p>



<a name="233812511"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233812511" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233812511">(Apr 09 2021 at 12:32)</a>:</h4>
<p>hmm actually I vaguely remember <code>--stage 1</code> builds not working with clippy in the past</p>



<a name="233812538"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233812538" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233812538">(Apr 09 2021 at 12:32)</a>:</h4>
<p>the real test is if moving <code>stage0-tools-bin/clippy-driver</code> to stage1/bin works</p>



<a name="233812942"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233812942" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edd Barrett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233812942">(Apr 09 2021 at 12:35)</a>:</h4>
<p>There is no <code>stage0-tools-bin</code> directory in my <code>build/</code> .</p>
<p>Searching all stage0 dirs, I don't see a clippy-driver binary:</p>
<div class="codehilite"><pre><span></span><code>$ find stage0-* -name &#39;clippy-driver&#39;
$
</code></pre></div>



<a name="233812967"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233812967" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233812967">(Apr 09 2021 at 12:35)</a>:</h4>
<p>yes you need to build it with <code>x.py build --stage 0 src/tools/clippy</code></p>



<a name="233813031"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233813031" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233813031">(Apr 09 2021 at 12:36)</a>:</h4>
<p>(running that locally but rustc_private is taking a while to compile - I think it's a bug in download-rustc, it shouldn't be compiled at all)</p>



<a name="233813078"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233813078" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233813078">(Apr 09 2021 at 12:36)</a>:</h4>
<p>remember that <code>build --stage 0</code> means "build with stage 0", it <em>generates</em> the stage1/ toolchain</p>



<a name="233813104"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233813104" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edd Barrett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233813104">(Apr 09 2021 at 12:36)</a>:</h4>
<p>Ah sorry. Building now...</p>



<a name="233813121"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233813121" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233813121">(Apr 09 2021 at 12:36)</a>:</h4>
<p>np</p>



<a name="233813184"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233813184" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edd Barrett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233813184">(Apr 09 2021 at 12:37)</a>:</h4>
<div class="codehilite"><pre><span></span><code>    Finished release [optimized] target(s) in 42.91s
thread &#39;main&#39; panicked at &#39;failed to copy `/home/vext01/source/rust/build/x86_64-unknown-linux-gnu/stage0-tools-bin/cargo-clippy` to `/home/vext01/source/rust/build/x86_64-unknown-linux-gnu/stage0-sysroot/bin/cargo-clippy`: No such file or directory (os error 2)&#39;, src/bootstrap/lib.rs:1206:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
failed to run: /home/vext01/source/rust/build/bootstrap/debug/bootstrap build --stage 0 src/tools/clippy/
Build completed unsuccessfully in 0:00:43
</code></pre></div>



<a name="233813242"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233813242" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233813242">(Apr 09 2021 at 12:37)</a>:</h4>
<p>that's your same bug as before - it's using the build sysroot</p>



<a name="233813340"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233813340" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233813340">(Apr 09 2021 at 12:38)</a>:</h4>
<p>it's copying to stage0-sysroot, it should be copying to stage1</p>



<a name="233813401"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233813401" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edd Barrett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233813401">(Apr 09 2021 at 12:39)</a>:</h4>
<p>ugh, let me revert my changes</p>



<a name="233813543"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233813543" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233813543">(Apr 09 2021 at 12:40)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E/near/233813031">said</a>:</p>
<blockquote>
<p>(running that locally but rustc_private is taking a while to compile - I think it's a bug in download-rustc, it shouldn't be compiled at all)</p>
</blockquote>
<div class="codehilite"><pre><span></span><code>        // NOTE: the ABI of the beta compiler is different from the ABI of the downloaded compiler,
        // so its artifacts can&#39;t be reused.
        if builder.config.download_rustc &amp;&amp; compiler.stage != 0 {
</code></pre></div>
<p>rude why was past me so insistent on things <em>working</em> <span aria-label="joy" class="emoji emoji-1f602" role="img" title="joy">:joy:</span></p>



<a name="233813786"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233813786" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edd Barrett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233813786">(Apr 09 2021 at 12:42)</a>:</h4>
<p>copying <code>clippy-driver</code> and <code>cargo-clippy</code> from <code>stage0-tools-bin</code> into <code>stage1/bin</code> works.</p>



<a name="233813830"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233813830" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edd Barrett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233813830">(Apr 09 2021 at 12:42)</a>:</h4>
<p>So I just need to fix which sysroot I copy from.</p>



<a name="233813901"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233813901" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233813901">(Apr 09 2021 at 12:43)</a>:</h4>
<p>I think this should actually go in <code>impl Step for Assemble</code></p>



<a name="233813908"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233813908" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233813908">(Apr 09 2021 at 12:43)</a>:</h4>
<p>otherwise the target sysroot may not yet exist</p>



<a name="233813973"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233813973" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edd Barrett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233813973">(Apr 09 2021 at 12:43)</a>:</h4>
<p>OK, i'll have to do some reading and experimentation</p>



<a name="233813976"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233813976" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233813976">(Apr 09 2021 at 12:43)</a>:</h4>
<p>somewhere around here: <a href="https://github.com/rust-lang/rust/blob/bc66b92f7f1114a78b98504a927ca9c0aa12c71a/src/bootstrap/compile.rs#L1122">https://github.com/rust-lang/rust/blob/bc66b92f7f1114a78b98504a927ca9c0aa12c71a/src/bootstrap/compile.rs#L1122</a></p>



<a name="233814007"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233814007" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edd Barrett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233814007">(Apr 09 2021 at 12:43)</a>:</h4>
<p>Thanks for your help. I'm criminally unfamiliar with the bootstrap code and I'm stll in that "oh, well this is overwhelming" stage :)</p>



<a name="233814059"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233814059" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233814059">(Apr 09 2021 at 12:44)</a>:</h4>
<p>haha yeah bootstrap is a little overwhelming <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="233814085"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233814085" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233814085">(Apr 09 2021 at 12:44)</a>:</h4>
<p>not so much the logic, but the amount going on</p>



<a name="233814236"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233814236" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233814236">(Apr 09 2021 at 12:46)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116122">simulacrum</span> described it as "lots of persistent state"</p>



<a name="233814363"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233814363" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edd Barrett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233814363">(Apr 09 2021 at 12:46)</a>:</h4>
<p>yeah</p>



<a name="233814374"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233814374" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edd Barrett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233814374">(Apr 09 2021 at 12:47)</a>:</h4>
<p>What does "assemble" mean in this context btw?</p>



<a name="233814399"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233814399" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233814399">(Apr 09 2021 at 12:47)</a>:</h4>
<p>it's just a fancy word for "copy things to the new sysroot"</p>



<a name="233814439"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233814439" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233814439">(Apr 09 2021 at 12:47)</a>:</h4>
<p><a href="https://rustc-dev-guide.rust-lang.org/building/bootstrapping.html#assembling-the-compiler">https://rustc-dev-guide.rust-lang.org/building/bootstrapping.html#assembling-the-compiler</a></p>



<a name="233819229"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233819229" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edd Barrett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233819229">(Apr 09 2021 at 13:20)</a>:</h4>
<p>OK, so this appears to work:</p>
<div class="codehilite" data-code-language="Diff"><pre><span></span><code><span class="gh">diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs</span>
<span class="gh">index 8244c7710ab..b281dca36ff 100644</span>
<span class="gd">--- a/src/bootstrap/compile.rs</span>
<span class="gi">+++ b/src/bootstrap/compile.rs</span>
<span class="gu">@@ -1127,6 +1127,20 @@ impl Step for Assemble {</span>
         let compiler = builder.rustc(target_compiler);
         builder.copy(&amp;rustc, &amp;compiler);

<span class="gi">+        use crate::tool::{CargoClippy, Clippy};</span>
<span class="gi">+        let clippy_bin = builder.ensure(Clippy {</span>
<span class="gi">+            compiler: build_compiler,</span>
<span class="gi">+            target: build_compiler.host,</span>
<span class="gi">+            extra_features: Vec::new(),</span>
<span class="gi">+        });</span>
<span class="gi">+        builder.copy(&amp;clippy_bin.unwrap(), &amp;bindir.join("clippy-driver"));</span>
<span class="gi">+        let cargo_clippy_bin = builder.ensure(CargoClippy {</span>
<span class="gi">+            compiler: build_compiler,</span>
<span class="gi">+            target: build_compiler.host,</span>
<span class="gi">+            extra_features: Vec::new(),</span>
<span class="gi">+        });</span>
<span class="gi">+        builder.copy(&amp;cargo_clippy_bin.unwrap(), &amp;bindir.join("cargo-clippy"));</span>
<span class="gi">+</span>
         target_compiler
     }
 }
</code></pre></div>
<p>Obviously this is quick and dirty. I shouldn't hard-code tool names and I need to ensure these are only built if requested in <code>config.toml</code>.</p>
<p>Looks on the right track?</p>



<a name="233819522"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233819522" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edd Barrett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233819522">(Apr 09 2021 at 13:22)</a>:</h4>
<p>Should there perhaps be a loop over all of the optional extended tools that does the same if they are enabled?</p>



<a name="233819877"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233819877" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233819877">(Apr 09 2021 at 13:24)</a>:</h4>
<p>hmm I think you can do this more simply - you can just copy everything in <code>builder.tools_dir(build_compiler)</code></p>



<a name="233819925"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233819925" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233819925">(Apr 09 2021 at 13:24)</a>:</h4>
<p>and that will take care of whether the tool should be built or not</p>



<a name="233820293"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233820293" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233820293">(Apr 09 2021 at 13:27)</a>:</h4>
<p>(I found that by looking at what <code>impl Step for ToolBuild</code> returns)</p>



<a name="233825297"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233825297" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edd Barrett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233825297">(Apr 09 2021 at 13:59)</a>:</h4>
<blockquote>
<p>hmm I think you can do this more simply - you can just copy everything in builder.tools_dir(build_compiler)</p>
</blockquote>
<p>I don't think that's right. Here that directory resolves to <code>build/x86_64-unknown-linux-gnu/stage0-tools-bin</code> which is an empty directory for a stage1 build.</p>



<a name="233825420"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233825420" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edd Barrett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233825420">(Apr 09 2021 at 14:00)</a>:</h4>
<p>s/build_compiler/target_compiler/ perhaps?</p>



<a name="233825933"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233825933" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233825933">(Apr 09 2021 at 14:02)</a>:</h4>
<p>try it and see? :P</p>



<a name="233827107"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233827107" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edd Barrett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233827107">(Apr 09 2021 at 14:09)</a>:</h4>
<p>Ugh. It works the second time you run <code>x.py build --stage 1</code>. Presumably this point is too early in the build and the tools don't exist yet.</p>



<a name="233827366"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233827366" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233827366">(Apr 09 2021 at 14:11)</a>:</h4>
<p>hmm - <span class="user-mention" data-user-id="116122">@simulacrum</span> do you happen to know what's going on? we're trying to make sure all the binaries in <code>stage0-tools-bin</code> end up in <code>stage1/bin</code></p>



<a name="233827548"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233827548" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233827548">(Apr 09 2021 at 14:12)</a>:</h4>
<p>That seems like an odd goal to me, they are of a different stage - if anything, they should go into stage0/bin, if they're bootstrap tools. Other than that I don't really have the time to investigate much</p>



<a name="233827997"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233827997" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233827997">(Apr 09 2021 at 14:15)</a>:</h4>
<p>hmm, how do you mean? isn't stage0-tools-bin for tools built by the stage0 compiler?</p>



<a name="233828065"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233828065" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233828065">(Apr 09 2021 at 14:15)</a>:</h4>
<p>I don't remember, maybe it is</p>



<a name="233828077"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233828077" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233828077">(Apr 09 2021 at 14:15)</a>:</h4>
<p>regardless, I have no immediate thoughts</p>



<a name="233828109"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Making%20fmt%20and%20clippy%20work%20for%20rustup%20%20linked%20toolchains./near/233828109" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Making.20fmt.20and.20clippy.20work.20for.20rustup.20.20linked.20toolchains.2E.html#233828109">(Apr 09 2021 at 14:15)</a>:</h4>
<p>ok, no problem :) I'll keep looking into it</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>